﻿@model Project.WebUI.Models.ChangePasswordModel
@using Project.Resource.User         
@{
    ViewBag.Title = "Gamebetplus - ChangePassword";
    var action = ViewContext.Controller.ValueProvider.GetValue("action").RawValue.ToString();
    var controller = ViewContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString();
}

@{
    var culture = "";
    if (Session["Culture"] != null && Session["Culture"].ToString().Equals("vi-VN"))
    {
        culture = "vi-VN";
    }
    var status ="0";
    if (ViewBag.success=="1")
    {
        status = "1";
    }
}


<script type="text/javascript">
    var action = '@action';
    $(document).ready(function () {
        if (action.toString() == 'ChangePassword') {
            $('.item').removeClass('active');
            $('#change_content').addClass('active');
        }
    });            
</script>

<div id="pass_incorrect" title="Login" style="display: none;">
   Login unsuccessfully!. Username or Password is incorrect
</div>

<section class="container clearfix">
       <div class="head_table">
        <div class="head_title_table">
            Profile Detail            
        </div>
    </div>  
    <div id="content" style="margin-top: 10px;">
        <table width="100%">
            <tr>
                <td width="237" valign="top">
                    <div class="left_content">
                        @Html.Partial("_MenuProfile")
                    </div>
                </td>
                <td valign="top">
                    <div class="right_content">
                        <div id="indexView" class="table">                            
                            <div class="head_table">
                                <div class="head_title_table" id="Module_Content">Secure User</div>
                            </div>
                            <div class="clearAll"></div>

                            <div id="ajax_loadContent">
                                @using (Html.BeginForm("ChangePassword", "User", FormMethod.Post, new { id = "formChPassword" }))
                                {                
                                    @Html.AntiForgeryToken() 
                                    <div class="content_table">
                                        <table cellspacing="0" cellpadding="0" border="0" width="100%">
                                            <tr class="row1">
                                                <td class="th_left" style="width: 114px;">Current Password
                                                </td>
                                                <td class="th_left">
                                                    @Html.TextBoxFor(m => m.CurrentPassword, new {type="password", @class="cf_input_200"})
                                                    @Html.ValidationMessageFor(m => m.CurrentPassword)
                                                </td>
                                            </tr>
                                            <tr class="row2">
                                                <td class="th_left">New Password
                                                </td>

                                                <td class="th_left">
                                                    @Html.TextBoxFor(m => m.Password,new {type="password", @class="cf_input_200"})
                                                    @Html.ValidationMessageFor(m => m.Password)
                                                </td>
                                            </tr>
                                            <tr class="row1">
                                                <td class="th_left">Confirm Password
                                                </td>

                                                <td class="th_left">
                                                    @Html.TextBoxFor(m => m.ConfirmPassword,new {type="password", @class="cf_input_200"})
                                                    @Html.ValidationMessageFor(m => m.ConfirmPassword)
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <div class="footer_table">
                                        <div class="item_per_page" style="margin: 0 !important;">
                                            <div onclick="return $('#formChPassword').submit();" class="btSubmit"></div>
                                        </div>
                                    </div>
                                }
                            </div>
                        </div>
                        <div class="clearAll"></div>                       
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div class="clear padding40"></div>
</section>
<div id="ChangePassword" title="Change Password Successfull" style="display: none;">
    @ChangePasswordResource.ChangePassSuccess
</div>
<script type="text/javascript">
    var id = "ChangePassword";
    if ("@status" == "1") {
        popupSite(id);
        $("#Password").val("");
        $("#ConfirmPassword").val("");
        $("#CurrentPassword").val("");
    }
</script>